package com.hliushi.adapter.example01;

/**
 * 通用适配器
 *
 * @author: hliushi
 * @date: 2023/2/13 22:29
 **/
public class Adapter implements TriplePin {

    private DualPin dualPinDevice;

    /**
     * 创建适配器时，需要把两相插孔设备接入进来
     *
     * @param dualPinDevice
     */
    public Adapter(DualPin dualPinDevice) {
        this.dualPinDevice = dualPinDevice;
    }

    @Override
    public void electrify(int fireWire, int neutralWire, int groundWire) {
        // 调用被适配设备的两相通电方式，忽略地线参数 groundWire
        dualPinDevice.electrify(fireWire, neutralWire);
    }
}
